﻿using System;
using viNews.Classes;
using viNews.Controllers;
using visinia.SmartEngine;
using visinia.SmartEngine.Site;

public partial class ClientScripts_viNews_Comments_RenderComment : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(Request.QueryString["CommentId"] != null)
        {
            int commentid = 0;
            if (Int32.TryParse(Request.QueryString["CommentId"], out commentid))
            {
                Comment comment = CommentController.GetApprovedComment(commentid);
                CommentView commentview = (CommentView)LoadControl(WebRoots.GetThemesRoot + SiteSettings.Theme + "/viNews/CommentView.ascx");
                commentview.Comment = comment;
                Controls.Add(commentview);
            }
        }
    }
}
